package com.bolao.teamFragments;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import com.Adapter.MatchAdapter;
import com.bolao.R;
import com.entidades.Match;
import com.entidades.Team;


@SuppressLint("ValidFragment")
public class TeamMatchsFragment extends Fragment {

	private Team mTeam;
	
	public TeamMatchsFragment(Team team){
		mTeam = team;
	}

	private ListView listView;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		
		View rootView = inflater.inflate(R.layout.team_fragment_match_list, container, false);

		listView = (ListView) rootView.findViewById(R.id.listViewTeamMatches);
		MatchAdapter mAdapter = new MatchAdapter(container.getContext(), Match.getMatchesOfTeam(mTeam), false);
		listView.setAdapter(mAdapter);

		
		return rootView;
		
	}

}
